package com.junchao.peng.pojo;

import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;
import java.util.Objects;

/**
 * @author dell
 */
public class Search implements Serializable {

    private static final long serialVersionUID = 1L;

    private Integer id;
    private String name;
    private String account;
    private String department;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date loginTime;

    public Search(Integer id, String name, String account, String department, Date loginTime) {
        this.id = id;
        this.name = name;
        this.account = account;
        this.department = department;
        this.loginTime = loginTime;
    }

    public Search() {
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    public String getDepartment() {
        return department;
    }

    public void setDepartment(String department) {
        this.department = department;
    }

    public Date getLoginTime() {
        return loginTime;
    }

    public void setLoginTime(Date loginTime) {
        this.loginTime = loginTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof Search)) {
            return false;
        }
        Search search = (Search) o;
        return getId().equals(search.getId()) && getName().equals(search.getName()) && getAccount().equals(search.getAccount()) && getDepartment().equals(search.getDepartment()) && getLoginTime().equals(search.getLoginTime());
    }

    @Override
    public int hashCode() {
        return Objects.hash(getId(), getName(), getAccount(), getDepartment(), getLoginTime());
    }

    @Override
    public String toString() {
        return "Search{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", account='" + account + '\'' +
                ", department='" + department + '\'' +
                ", loginTime=" + loginTime +
                '}';
    }
}
